<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

  <title><?php echo Options::value('site_name') ?></title>

  <?php echo $this->html->css('reset') ?>
  <?php echo $this->html->css('style') ?>
  <?php echo $this->html->css('forms') ?>

  <?php echo $this->javascript->link('jquery') ?>

  <?php echo $this->html->css('ui-lightness/jquery-ui-1.8.16.custom.css') ?>
  <?php echo $this->javascript->link('jquery-ui') ?>

  <?php echo $this->html->css(Simplify::config()->get('theme_url') . '/fancybox/jquery.fancybox-1.3.4.css') ?>
  <?php echo $this->javascript->link(Simplify::config()->get('theme_url') . '/fancybox/jquery.fancybox-1.3.4.pack.js') ?>
  
  <script>
  $(document).ready(function() {
    $('.lightbox').fancybox();
  });
  </script>
</head>

<body>
  <div class="wrapper">
    <div id="header" class="wrapped page-width">
      <h1><a href="<?php echo Simplify::response()->makeUrl('/admin') ?>"><?php echo Options::value('site_name') ?></a>
        <small><a href="<?php echo Simplify::response()->makeUrl('/') ?>">ir para o site</a></small>
      </h1>

      <nav id="user-menu">
        <?php if ($user = Account::getUser()) { ?>
        <ul class="menu tiled-list">
          <li class="menu-item list-item">Logado como <?php echo $user['user_email'] ?></li>
          <li class="menu-item list-item"><a href="<?php echo Simplify::response()->makeUrl('/') ?>">ir para o site</a></li>
          <li class="menu-item list-item"><a href="<?php echo Simplify::response()->makeUrl('/admin/account', array('action' => 'logout')) ?>">logout</a></li>
        </ul>
        <?php } ?>
      </nav>
    </div>
  </div>

  <div class="wrapper">
    <div class="wrapped page-width">
      <div id="sidebar">
        <nav id="main-menu">
          <?php echo $this->amp_menu->show(Simplify::getInstance()->menu()) ?>
        </nav>
      </div>

      <div id="content">
        <?php if ($messages = Simplify::getInstance()->warnings()) { ?>
        <div class="messages warnings">
          <ul>
          <?php foreach ($messages['*'] as $message) { ?>
            <li><?php echo $message ?></li>
          <?php } ?>
          </ul>
        </div>
        <?php } ?>

        <?php if ($messages = Simplify::getInstance()->notices()) { ?>
        <div class="messages notices">
          <ul>
          <?php foreach ($messages['*'] as $message) { ?>
            <li><?php echo $message ?></li>
          <?php } ?>
          </ul>
        </div>
        <?php } ?>

        <?php echo $layout_content ?>
      </div>
    </div>
  </div>
</body>
</html>